<template>
  <div>
      <h3  class="title" >注册页面</h3>
      <input type="text" v-model="user.phone" placeholder="手机号">
      <input type="text" v-model="user.nickname" placeholder="昵称">
      <input type="text" v-model="user.password" placeholder="密码">
      <hr>
      <button @click="register">注册</button>
  </div>
</template>

<script>
import { reqRegister } from '../../http/http'

export default {
data(){
    return {
        user:{
            phone: "",
        nickname: "",
        password: "",
        }
    }
},
methods:{
register(){
    reqRegister(this.user).then(res=>{
        console.log(res);
        if(res.data.code==200){
          //成功
          alert(res.data.msg)
          //跳转登录
          this.$router.push("/login")
        }
    })
}
}
}
</script>

<style>

</style>